google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(function(){ var data = new google.visualization.DataTable(); data.addColumn('string', '日'); data.addColumn('number', '推測'); data.addColumn('number', '推測'); data.addColumn('number', 'iOS前月'); data.addColumn('number', 'iOS当月'); data.addRows([ ['1日',436,482,null,null], ['2日',447,null,null,null], ['3日',459,489,null,null], ['4日',437,321,null,null], ['5日',404,327,null,null], ['6日',402,320,null,null], ['7日',392,333,null,null], ['8日',356,331,null,null], ['9日',366,325,null,null], ['10日',395,311,null,null], ['11日',397,309,null,null], ['12日',392,332,null,null], ['13日',405,340,null,null], ['14日',420,367,null,null], ['15日',302,370,null,null], ['16日',314,369,null,null], ['17日',335,366,null,null], ['18日',329,337,null,null], ['19日',318,377,null,null], ['20日',319,433,null,null], ['21日',303,440,null,null], ['22日',349,462,null,null], ['23日',379,464,null,null], ['24日',411,478,null,null], ['25日',432,null,null,null], ['26日',419,356,null,null], ['27日',436,380,null,null], ['28日',460,382,null,null], ['29日',445,387,null,null], ['30日',924,392,null,null], ['31日',null,null,null,null] ]); var options = { chartArea: {'width':'85%', 'height':'65%', 'left':60 }, 'pointSize': 3, hAxis: { titleTextStyle:{italic:false}, format:'#',ticks: [1,5,10,15,20,25,30] }, vAxis: { title:'2024年4月ランキング', titleTextStyle:{italic:false}, format:'#',viewWindow:{min:0,max:1000},direction:-1 }, legend: {position: 'top' }, tooltip: { trigger: 'both' }, focusTarget: 'category', colors:['skyblue','pink','#2980b9','#e74c3c'] }; var chart = new google.visualization.LineChart(document.getElementById('graphField')); chart.draw(data, options); var lastlogday=30 -1 ; var lastlogcat=2; if(lastlogday>=0){ chart.setSelection([{ row: lastlogday, column: lastlogcat }]); google.visualization.events.addListener(chart, 'click', function() { if(chart.getSelection()[0]){ //chart.setSelection(null) } }); } });